<template>
	<view :style="themeColor">
		<view class="page">
			<view class="flex benben-position-layout flex flex-wrap align-center userEvaluation_flex_0"
				:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
				<view class='flex flex-wrap align-center justify-between flex-sub userEvaluation_fd0_0'>
					<view class='flex flex-wrap align-center userEvaluation_fd0_0_c0' @tap.stop="handleJumpDiy"
						data-type="back" data-url="1">
						<text class='fu-iconfont2  userEvaluation_fd0_0_c0_c0'>&#xe794;</text>
					</view>
					<text class='userEvaluation_fd0_0_c1'>用户评价</text>
					<view class='flex flex-wrap align-center userEvaluation_fd0_0_c0'>
					</view>
				</view>

			</view>
			<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
			<!---flex布局flex布局开始-->
			<view class="flex benben-flex-layout flex-wrap align-center userEvaluation_flex_1" v-if=" type!='1'">
				<view class='flex flex-wrap align-center'>
					<text class='userEvaluation_fd1_0_c0'>好评率：</text>
				</view>
				<view class='flex flex-wrap align-center'>
					<text class='userEvaluation_fd1_1_c0'>{{commentHeaders.good_radio}}</text>
				</view>
			</view>

			<!---flex布局flex布局结束-->
			<!---flex布局flex布局开始-->
			<view class="flex benben-flex-layout flex-wrap align-center userEvaluation_flex_2" v-if=" type!='1'">
				<benben-select-diy ref="showSelectPopup1695023389283" class-name='flex flex-wrap align-center flex'
					:items.sync="commentHeaders.num" v-model="headId" @change="getEvaluateFunc()" default-type="aid"
					default-label="name" :allow-cancel='false' type="radio" :disabled='false'>
					<template v-for='(item,key0) in commentHeaders.num'>
						<view v-if="item.isSelected"
							class='flex align-center justify-center flex userEvaluation_fd2_0_c0' :key="key0"
							@tap="$refs.showSelectPopup1695023389283.tapHandle(key0)">
							<text class='userEvaluation_fd2_0_c0_c0'>{{item.name}}</text>
						</view>
						<view v-else class='flex align-center justify-center flex userEvaluation_fd2_0_c1' :key="key0"
							@tap="$refs.showSelectPopup1695023389283.tapHandle(key0)">
							<text class='userEvaluation_fd2_0_c1_c0'>{{item.name}}</text>
						</view>
					</template></benben-select-diy>
			</view>

			<!---flex布局flex布局结束-->
			<!---flex布局flex布局开始-->
			<view class="flex flex-direction flex-wrap align-stretch benben-flex-layout userEvaluation_flex_3">
				<template v-for='(item,key0) in evaluateList'>
					<view class='flex flex-direction flex-wrap align-stretch userEvaluation_fd3_0' :key='key0'>
						<view class='flex flex-wrap align-center userEvaluation_fd3_0_c0'>
							<image class='self-start userEvaluation_fd3_0_c0_c0' mode="aspectFit"
								:src='item.user_avatar'></image>
							<view class='flex flex-direction flex-wrap align-stretch flex-sub'>
								<view class='flex flex-wrap align-center justify-between'>
									<text
										class='flex-sub userEvaluation_fd3_0_c0_c1_c0_c0'>{{item.user_nickname}}</text>
									<text class='userEvaluation_fd3_0_c0_c1_c0_c1'>{{item.create_time}}</text>
								</view>
								<view class='flex flex-wrap align-center userEvaluation_fd3_0_c0_c1_c1'>
									<view class='flex flex-wrap align-center'>
										<template v-for="starNum in [1,2,3,4,5]">
											<image v-if="item.evaluate_star >= starNum" :key="starNum"
												class='userEvaluation_star1fd3_0_c0_c1_c1_c0' mode="aspectFit"
												:src='STATIC_URL+"105.png"'></image>
											<image v-else :key="starNum" class='userEvaluation_star1fd3_0_c0_c1_c1_c0'
												mode="aspectFit" :src='STATIC_URL+"104.png"'></image>
										</template>
									</view>
								</view>
							</view>
						</view>
						<text class='userEvaluation_fd3_0_c1'>{{item.evaluate_content}}</text>
						<view class='flex flex-wrap align-center userEvaluation_fd3_0_c2'>
							<template v-for='(child,key1) in item.evaluate_picture'>
								<view class='flex flex-wrap align-center userEvaluation_fd3_0_c2_c0' :key='key1'>
									<image class='userEvaluation_fd3_0_c2_c0_c0' mode="aspectFill" :src='child'
										@tap.stop="multiImagePreview(child,item.evaluate_picture,'')"></image>
								</view>
							</template>

						</view>
						<view class='userEvaluation_fd3_0_c3' v-if=" item.reply!=''">
							<text class='userEvaluation_fd3_0_c3_c0'>平台回复：</text>
							<text>{{item.reply}}</text>
						</view>
						<view class='flex flex-wrap align-center userEvaluation_fd3_0_c4'>
						</view>
					</view>
				</template>
				<fu-empty :pagingListLoadedAll="pagingListLoadedAll" :pagingListNoListData="pagingListNoListData"
					:listDataLength="listDataLength" :isLoadInit="isLoadInit"></fu-empty>
			</view>

			<!---flex布局flex布局结束-->


		</view>
	</view>
</template>
<script>
	import pagingList from '@/common/mixin/paging_list.js';
	import {
		validate
	} from '@/common/utils/validate.js'

	export default {
		components: {},
		mixins: [pagingList],

		data() {
			return {
				"minixPagingListsApi": "",
				"pageingListApiMethod": "",
				"allowOnloadGetList": false,
				"evaluateList": [],
				"commentHeaders": {
					"good_radio": "",
					"num": []
				},
				"headId": "0",
				"id": "",
				"serviceproject_id": "",
				"type": ""
			};
		},
		computed: {
			themeColor() {
				return this.$store.getters.themeColor
			},

		},
		watch: {},
		onLoad(options) {
			let {
				id,
				serviceproject_id,
				type
			} = options
			if (id !== undefined) this.id = id
			if (serviceproject_id !== undefined) this.serviceproject_id = serviceproject_id
			if (type !== undefined) this.type = type
			this.getEvaluateFunc()
			this.getCommentHeadersFunc()
		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {

		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {
			this.getEvaluateFunc()
		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			//获取评价列表
			getEvaluateFunc() {
				this.minixPagingListsApi = global.apiUrls.post6393f56c84ece;
				this.pageingListApiMethod = 'get';
				this.allowOnloadGetList = false;
				this.pagingListPostDataContent = {
					serviceproject_id: this.serviceproject_id,
					order_id: this.id,
					type: this.headId
				}
				this.listData = [];
				this.evaluateList = this.listData;
				this.pagingListToggle();

			},
			//评价头部
			async getCommentHeadersFunc() {
				//请求方法
				//数据验证

				let datacommentHeaders = await this.$api.get(global.apiUrls.post6507ebe91cbe2, {
					serviceproject_id: this.serviceproject_id
				});

				if (datacommentHeaders.data.code != 1) {
					this.$message.info(datacommentHeaders.data.msg);
					return
				}
				let infocommentHeaders = datacommentHeaders.data;
				this.commentHeaders = infocommentHeaders.data

			},
			pagingListPostData() {
				return this.pagingListPostDataContent
			}
		}
	};
</script>
<style lang="scss" scoped>
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: #fff;
		background-size: 100% auto;
	}

	.userEvaluation_flex_0 {
		border-bottom: 1px solid #eee;
		background: #fff;
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto !important;
	}

	.userEvaluation_fd0_0_c1 {
		font-size: 36rpx;
		font-weight: 400;
		color: #333;
		line-height: 50rpx;
	}

	.userEvaluation_fd0_0_c0_c0 {
		font-size: 32rpx;
		color: #333;
	}

	.userEvaluation_fd0_0_c0 {
		width: 120rpx;
		height: 88rpx;
	}

	.userEvaluation_fd0_0 {
		padding: 0rpx 32rpx 0rpx 32rpx;
		height: 88rpx;
	}

	.userEvaluation_flex_1 {
		background: rgba(255, 157, 71, 0.1);
		background-size: 100% auto;
		padding: 0rpx 32rpx 0rpx 32rpx;
		height: 72rpx;
	}

	.userEvaluation_fd1_1_c0 {
		color: rgba(255, 157, 71, 1);
		font-size: 28rpx;
	}

	.userEvaluation_fd1_0_c0 {
		color: rgba(255, 157, 71, 1);
	}

	.userEvaluation_flex_2 {
		padding: 32rpx 32rpx 32rpx 32rpx;
	}

	.userEvaluation_fd2_0_c1_c0 {
		font-size: 28rpx;
		font-weight: 400;
		color: #333;
		line-height: 33rpx;
	}

	.userEvaluation_fd2_0_c1 {
		background: rgba(248, 248, 248, 1);
		background-size: 100% auto;
		width: 200rpx;
		height: 56rpx;
		border-radius: 28rpx 28rpx 28rpx 28rpx;
		margin: 0rpx 16rpx 24rpx 0rpx;
	}

	.userEvaluation_fd2_0_c0_c0 {
		font-size: 28rpx;
		font-weight: 400;
		color: rgba(48, 144, 255, 1);
		line-height: 33rpx;
	}

	.userEvaluation_fd2_0_c0 {
		border: 1px solid rgba(48, 144, 255, 1);
		background: rgba(48, 144, 255, 0.06);
		width: 200rpx;
		height: 56rpx;
		border-radius: 28rpx 28rpx 28rpx 28rpx;
		background-size: 100% auto;
		margin: 0rpx 16rpx 24rpx 0rpx;
	}

	.userEvaluation_flex_3 {
		background: #fff;
		background-size: 100% auto !important;
		border-radius: 24rpx 24rpx 0rpx 0rpx;
	}

	.userEvaluation_fd3_0_c4 {
		border-bottom: 1px solid #eee;
		margin: 8rpx 32rpx 0rpx 32rpx;
		width: 686rpx;
		height: 1rpx;
	}

	.userEvaluation_fd3_0_c3_c0 {
		font-size: 28rpx;
		font-weight: 400;
		color: var(--benbenFontColor4);
	}

	.userEvaluation_fd3_0_c3 {
		margin: 0rpx 32rpx 0rpx 32rpx;
	}

	.userEvaluation_fd3_0_c2_c0_c0 {
		width: 226rpx;
		height: 226rpx;
		border-radius: 8rpx 8rpx 8rpx 8rpx;
	}

	.userEvaluation_fd3_0_c2_c0 {
		margin: 0rpx 2rpx 24rpx 2rpx;
	}

	.userEvaluation_fd3_0_c2 {
		padding: 0rpx 30rpx 0rpx 30rpx;
	}

	.userEvaluation_fd3_0_c1 {
		font-size: 28rpx;
		font-weight: 400;
		color: #333333;
		margin: 0rpx 32rpx 24rpx 32rpx;
		line-height: 40rpx;
	}

	.userEvaluation_star1fd3_0_c0_c1_c1_c0 {
		height: 19rpx;
		margin: 0rpx 4rpx 0rpx 0rpx;
		width: 19rpx;
	}

	.userEvaluation_star1fd3_0_c0_c1_c1_c0 {
		width: 19rpx;
		height: 19rpx;
		margin: 0rpx 4rpx 0rpx 0rpx;
	}

	.userEvaluation_fd3_0_c0_c1_c1 {
		margin: 8rpx 0rpx 0rpx 0rpx;
	}

	.userEvaluation_fd3_0_c0_c1_c0_c1 {
		font-size: 24rpx;
		font-weight: 400;
		color: #999999;
		line-height: 33rpx;
	}

	.userEvaluation_fd3_0_c0_c1_c0_c0 {
		color: #333333;
		font-size: 32rpx;
		font-weight: 400;
		line-height: 40rpx;
		margin: 0rpx 32rpx 0rpx 0rpx;
		-webkit-line-clamp: 1;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-box-orient: vertical;
	}

	.userEvaluation_fd3_0_c0_c0 {
		width: 80rpx;
		height: 80rpx;
		border-radius: 40rpx 40rpx 40rpx 40rpx;
		margin: 0rpx 24rpx 0rpx 0rpx;
	}

	.userEvaluation_fd3_0_c0 {
		margin: 0rpx 32rpx 24rpx 32rpx;
	}

	.userEvaluation_fd3_0 {
		padding: 32rpx 0rpx 0rpx 0rpx;
	}
</style>